﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.Model;
using Automobile.service.BLL;
using System.Data;
namespace Automobile.service.UI.Handler
{
    /// <summary>
    /// PurchaseOut_Add 的摘要说明
    /// </summary>
    public class PurchaseOut_Add : IHttpHandler
    {
        PurchaseOutBLL bll = new PurchaseOutBLL();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Purchase P = new Purchase();
            P.Purchase_date = DateTime.Now;
            P.Purchase_Remark = context.Request["Purchase_Remark"];
            P.SumMoney = Convert.ToInt32(context.Request["sumM"]);
            P.Supplier_Id = Convert.ToInt32(context.Request["Supplier_Id"]);
            P.WareHose_Id = Convert.ToInt32(context.Request["WareHose_Id"]);
            P.Employee_Id = Convert.ToInt32(context.Request["Employee_Id"]);
            P.PurChase_InOut = "返厂";
            string xml = context.Server.UrlDecode(context.Request.Form["xml"].ToString());
            context.Response.Write(bll.Purchase_Add(P, xml));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}